package com.lianrui.app.goods.dao;

import java.util.List;

import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.lianrui.app.goods.domain.Product;
import com.lianrui.app.goods.vos.ProductPage;
import com.lianrui.app.goods.vos.SpecVo;
import com.lianrui.commons.exception.BusinessException;
import com.lianrui.core.IDao;

/**
 * 
 * @Title:
 * @Description:
 * @Author:Yefq
 * @Since:2016年1月7日
 * @Version:1.1.0
 */
@Repository
public interface IProductDao extends IDao<ProductPage, Product, Integer> {

    @Override
    @ResultMap("productMap")
    @Select("select * from es_product where product_id = #{id}")
    public Product unique(Integer id) throws BusinessException;

    @Select("select * from es_product where goods_id = #{id}")
    @ResultMap("productMap")
    public List<Product> getProductBygoodsId(Integer id)
            throws BusinessException;

    public void deleteGoodsSpec(Integer... id) throws BusinessException;

    public void deleteGoodsLVPrice(Integer... id) throws BusinessException;

    public List<SpecVo> getSpecs(Integer goodsId) throws BusinessException;

}
